// symbol
const mySymbol = (function () {
    const cache = new Map();
    function fn(key) {
        if (this instanceof fn) {
            throw TypeError("不能使用new")
        }
        return {}
    }
    fn.for = function (key) {
        if (cache.has(key)) {
            cache.set(key, {})
        }
        return cache.get(key)
    }
    // 取symbol 值对应的key
    fn.keyFor = function (value) {
        for (const [k, v] of cache) {
            if (v === value) {
                return k
            }
        }
    }
    return fn
})()